﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace QuartzServices.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class init : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BLC_SAP_LOCATION",
                columns: table => new
                {
                    ID = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: false, defaultValueSql: "(newid())", comment: "主键"),
                    SLoc = table.Column<string>(type: "varchar(256)", unicode: false, maxLength: 256, nullable: true, comment: "SLoc"),
                    Material = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Material "),
                    Material_description = table.Column<string>(type: "varchar(256)", unicode: false, maxLength: 256, nullable: true, comment: "Material_description"),
                    Matlgrp = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "Matlgrp"),
                    Type = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "Type"),
                    C = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "C"),
                    Stand_Price = table.Column<decimal>(type: "decimal(18,5)", nullable: true, comment: "Stand Price"),
                    Unrestricted = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Unrestricted"),
                    Unrestr_cnsgt = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Unrestr. cnsgt "),
                    Stock_in_tfr = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Stock in tfr"),
                    In_qual_insp = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "In qual.insp."),
                    Cnsgt_qual_in = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Cnsgt qual.in"),
                    Blocked = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Blocked"),
                    Blocked_cnsgt = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "Blocked cnsgt"),
                    Total_Value = table.Column<decimal>(type: "decimal(18,5)", nullable: true, comment: "Total Value"),
                    MRP = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "MRP"),
                    Plnt = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "Plnt"),
                    P = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "P"),
                    M = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "M"),
                    TRADE_CO = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "企业唯一代码"),
                    TRADE_NAME = table.Column<string>(type: "varchar(256)", unicode: false, maxLength: 256, nullable: true, comment: "企业唯一名称"),
                    ENABLED = table.Column<int>(type: "int", nullable: true, comment: "有效标识"),
                    DELETEMARK = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "删除标志"),
                    CREATEON = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建日期"),
                    CREATEUSERID = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "创建用户主键"),
                    CREATEBY = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "创建用户"),
                    MODIFIEDON = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改日期"),
                    MODIFIEDUSERID = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "修改用户主键"),
                    MODIFIEDBY = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "修改用户"),
                    CHECK_CODE = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "查核代码"),
                    Unit = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Unit2 = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Unit3 = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Unit4 = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Unit5 = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Unit6 = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Unit7 = table.Column<string>(type: "nchar(10)", fixedLength: true, maxLength: 10, nullable: true),
                    Upload_Time = table.Column<DateTime>(type: "datetime", nullable: true),
                    Workcell = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "项目组")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK__SAP_LOCA__3214EC27C969A515", x => x.ID);
                },
                comment: "SAP库存正式表");

            migrationBuilder.CreateTable(
                name: "JABIL_API_TOKEN",
                columns: table => new
                {
                    ID = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: false, defaultValueSql: "(newid())", comment: "主键"),
                    TOKEN = table.Column<string>(type: "varchar(max)", unicode: false, nullable: true, comment: "TOKEN"),
                    TRADE_CO = table.Column<string>(type: "varchar(32)", unicode: false, maxLength: 32, nullable: true, comment: "企业唯一代码"),
                    TRADE_NAME = table.Column<string>(type: "varchar(256)", unicode: false, maxLength: 256, nullable: true, comment: "企业唯一名称"),
                    ENABLED = table.Column<int>(type: "int", nullable: true, defaultValueSql: "('1')", comment: "有效标识"),
                    DELETEMARK = table.Column<int>(type: "int", nullable: true, defaultValueSql: "('0')", comment: "删除标志"),
                    CREATEON = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建日期"),
                    CREATEUSERID = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "创建用户主键"),
                    CREATEBY = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "创建用户"),
                    MODIFIEDON = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改日期"),
                    MODIFIEDUSERID = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "修改用户主键"),
                    MODIFIEDBY = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: true, comment: "修改用户"),
                    SystemID = table.Column<int>(type: "int", nullable: true, comment: "SystemID:"),
                    account = table.Column<string>(type: "varchar(255)", unicode: false, maxLength: 255, nullable: true),
                    password = table.Column<string>(type: "varchar(255)", unicode: false, maxLength: 255, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK__JABIL_AP__3214EC274E7C95E3", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Serilogs",
                columns: table => new
                {
                    Id = table.Column<string>(type: "varchar(64)", unicode: false, maxLength: 64, nullable: false, defaultValueSql: "(newid())"),
                    Message = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MessageTemplate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Level = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TimeStamp = table.Column<DateTime>(type: "datetime", nullable: true),
                    Exception = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Properties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SourceContext = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ThreadId = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
                    FilePath = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
                    MemberName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    LineNumber = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Serilogs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "WEIXIN_OFFICIAL_ACCOUNT",
                columns: table => new
                {
                    ID = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false, defaultValueSql: "(newid())", comment: "公众号主键"),
                    OFFICIAL_ID = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "公众号ID"),
                    OFFICIAL_NAME = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "公众号名称"),
                    OFFICIAL_CODE = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "代码"),
                    OFFICIAL_KEY = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "密钥"),
                    OFFICIAL_PHOTO = table.Column<string>(type: "varchar(1000)", unicode: false, maxLength: 1000, nullable: true, comment: "照片"),
                    API_URL = table.Column<string>(type: "varchar(1000)", unicode: false, maxLength: 1000, nullable: true, comment: "中转URI"),
                    TOKEN = table.Column<string>(type: "varchar(500)", unicode: false, maxLength: 500, nullable: true, comment: "TOKEN"),
                    APP_ID = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "AppId"),
                    APP_SECRET = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "AppSecret"),
                    ACCESS_TOKEN = table.Column<string>(type: "varchar(200)", unicode: false, maxLength: 200, nullable: true, comment: "AccessToken"),
                    REMARK = table.Column<string>(type: "varchar(1000)", unicode: false, maxLength: 1000, nullable: true, comment: "备注"),
                    ENABLED = table.Column<int>(type: "int", nullable: true, comment: "是否启用"),
                    IS_DEFAULT = table.Column<int>(type: "int", nullable: true, comment: "当前操作号"),
                    CATEGORY = table.Column<int>(type: "int", nullable: true, comment: "类别"),
                    DELETE_MARK = table.Column<int>(type: "int", nullable: true, defaultValueSql: "((0))", comment: "删除标记"),
                    CREATE_ON = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建日期"),
                    CREATE_USER_ID = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户主键"),
                    CREATE_BY = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "创建用户"),
                    MODIFIED_ON = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改日期"),
                    MODIFIED_USER_ID = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户主键"),
                    MODIFIED_BY = table.Column<string>(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true, comment: "修改用户")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WEIXIN_OFFICIAL_ACCOUNT", x => x.ID)
                        .Annotation("SqlServer:Clustered", false);
                },
                comment: "微信-公众号");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BLC_SAP_LOCATION");

            migrationBuilder.DropTable(
                name: "JABIL_API_TOKEN");

            migrationBuilder.DropTable(
                name: "Serilogs");

            migrationBuilder.DropTable(
                name: "WEIXIN_OFFICIAL_ACCOUNT");
        }
    }
}
